package com.wnxy.mapper;

import com.wnxy.dto.RolePathDto;
import com.wnxy.model.Role;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author alice
 * @since 2021-11-12
 */
public interface RoleMapper extends BaseMapper<Role> {
    @Select("SELECT r.role_sign from t_manager_role mr join t_role r on mr.role_id= r.role_id WHERE mr.manager_id={managerId}")
    List<String> getRoleSign(Integer managerId);
    @Select("SELECT mr.manager_id, p.path_url,rp.role_id FROM t_path p JOIN t_role_path rp on p.path_id= rp.path_id JOIN t_manager_role mr on mr.role_id=rp.role_id")
    List<RolePathDto> selectAllPath();
}
